<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout}">

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <title th:text="#{cas.login.pagetitle}">Passwordless Display View</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag"/>
</head>

<body>
<main role="main" class="container mt-3 mb-3">
    <div layout:fragment="content" id="login" class="mdc-card card mdc-card-content w-lg-50 p-4 m-auto">
        <h3 th:text="#{passwordless.token.header}">Provide Token</h3>
        <p th:text="#{passwordless.token.description}"></p>
        <div class="banner banner-danger alert alert-danger mb-2" th:if="${error}">
            <strong th:text="#{passwordless.error.failure.title}"></strong>
            <p th:text="#{passwordless.error.failure.description}"></p>
        </div>
        <form method="post" id="fm1" class="d-block" th:action="@{/login}">
            <input type="hidden" name="_eventId_submit" value="LOGIN" />
            <input type="hidden" name="execution" th:value="${flowExecutionKey}" />
            <section class="cas-field form-group my-3 mdc-input-group d-flex">
                <div class="mdc-input-group-field mdc-input-group-field-append w-100">
                    <label for="token" class="mdc-text-field caps-check mdc-text-field--outlined control-label mdc-text-field--with-trailing-icon">
                        <span class="mdc-notched-outline">
                            <span class="mdc-notched-outline__leading"></span>
                            <span class="mdc-notched-outline__notch">
                                <span class="mdc-floating-label" th:utext="#{screen.welcome.label.token}">Token</span>
                            </span>
                            <span class="mdc-notched-outline__trailing"></span>
                        </span>
                        <input class="mdc-text-field__input form-control pwd" type="password" name="token" id="token" size="25"
                            autocomplete="off" required />
                    </label>

                </div>
                <button class="reveal-password align-self-end mdc-button mdc-button--raised btn btn-primary mdc-input-group-append mdc-icon-button"
                        type="button">
                    <i class="mdi mdi-eye fas fa-eye reveal-password-icon"></i>
                    <span class="visually-hidden">Toggle Token</span>
                </button>

                <div class="mdc-text-field-helper-line caps-warn">
                    <p
                        class="mdc-text-field-helper-text form-text text-small mdc-text-field-helper-text--persistent mdc-text-field-helper-text--validation-msg text-danger">
                        <span th:utext="#{screen.capslock.on}" />
                    </p>
                </div>
            </section>
            <div class="d-flex">
                <button class="mdc-button mdc-button--raised btn btn-primary me-2" accesskey="l" type="submit">
                    <span class="mdc-button__label" th:text="#{screen.welcome.button.login}">Login</span>
                </button>
                <a class="mdc-button mdc-button--outline btn btn-outline-secondary" id="cancel" name="cancel" th:href="@{/login}">
                    <span class="mdc-button__label" th:text="#{screen.consent.cancel}">Cancel</span>
                </a>
            </div>
        </form>
    </div>
</main>
</body>

</html>
